package com.ruoyi.prodata.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.material.service.IMateriaPurchaseRecordService;
import com.ruoyi.wbs.service.IContractorPaymentRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 进度款支付情况Controller
 *
 * @author yuhaoyang
 * @date 2024-06-19
 */
@RestController
@RequestMapping("/prodata/procurementStatistics")
public class ProcurementStatisticsController extends BaseController {

    @Autowired
    private IMateriaPurchaseRecordService purchaseRecordService;

    /**
     * 材料采购情况
     */
    @PreAuthorize("@ss.hasPermi('prodata:statistics:query')")
    @GetMapping("/{projectId}")
    public AjaxResult paymentStatistics(@PathVariable Long projectId) {
        return success(purchaseRecordService.paymentStatistics(projectId));
    }
}
